const request = require("../../utils/request1.js")
Component({
  data: {
    cur: {},
    number: 0,
    position: [
      { value: 'bottom', text: '立即租赁' },
    ],
    // 产品详情
    Product:''
  },
  methods: {
    onLoad() {
      this.getProduct()
    },
    // 产品详情
      getProduct(){
        const _this = this
        request.wxRequest('product/product', function (err, data) {
          console.log(data.data.detail)
          if (err) {
              // 失败；
          } else {
              _this.setData({
                Product: data.data.detail
              })
            }
          }, 'POST', {
            id: 1,
          })
        },
    // 返回上一页
    goBack(){
      wx.switchTab({
        url: '/pages/index/index',
      })
    },
    // 跳转
    goIbte(){
      wx.navigateTo({
        url: "/pages/interface/interface",
      })
    },
    increaseNumber() {
      this.setData({
        number: this.data.number + 1,
      });
    },
  
    decreaseNumber() {
      if (this.data.number > 0) {
        this.setData({
          number: this.data.number - 1,
        });
      }
    },
    handlePopup(e) {
      const { item } = e.currentTarget.dataset;
      this.setData(
        {
          cur: item,
        },
        () => {
          this.setData({ visible: true });
        },
      );
    },
    onVisibleChange(e) {
      this.setData({
        visible: e.detail.visible,
      });
    },
  },

});
